package com.syedu.day03.homework;

/**
 * description：
 *
 *   1*8+1= 9
 * 	 12*8+2= 98
 * 	 123*8+3= 987
 * 	 1234*8+4= 9876
 * 	 12345*8+5= 98765
 * 	 123456*8+6= 987654
 * 	 1234567*8+7= 9876543
 * 	 12345678*8+8= 98765432
 * 	 123456789*8+9= 987654321
 *
 * 	 1*9+2= 11
 * 	 12*9+3= 111
 * 	 123*9+4= 1111
 * 	 1234*9+5= 11111
 * 	 12345*9+6= 111111
 * 	 123456*9+7= 1111111
 * 	 1234567*9+8= 11111111
 * 	 12345678*9+9= 111111111
 * 	 123456789*9+10= 1111111111
 *
 * 	 9*9+7= 88
 * 	 98*9+6= 888
 * 	 987*9+5= 8888
 * 	 9876*9+4= 88888
 * 	 98765*9+3= 888888
 * 	 987654*9+2= 8888888
 * 	 9876543*9+1= 88888888
 * 	 98765432*9+0= 888888888
 *
 * @author Administrator
 * @date 2022/3/8 14:31
 */
public class AmazingNumber {
    public static void main(String[] args) {
        /*int start = 1, base = 8;
        for (int i = 1; i <= 9; i++) {
            System.out.println(start + "*" + base + "+" + i + "=" + (start * base + i));
            start *= 10;
            start += (i + 1);
        }*/

        /*int start = 1, base = 9;
        for (int i = 2; i <= 10; i++) {
            System.out.println(start + "*" + base + "+" + i + "=" + (start * base + i));
            start *= 10;
            start += i;
        }*/

        int start = 9, base = 9;
        for (int i = 7; i >= 0; i--) {
            System.out.println(start + "*" + base + "+" + i + "=" + (start * base + i));
            start *= 10;
            start += (i + 1);
        }
    }
}